#!/usr/bin/perl -w

use strict; 
use XML::LibXML;
use vars qw/ %opt /;


sub init()
{
  use Getopt::Std;
  my $opt_string = 'hvcdf:';
  getopts( "$opt_string", \%opt ) or usage();
  usage() if $opt{h};
}


sub create_xml()
{

print "creating XML...."

}
#
# Message about this program and how to use it
#
sub usage()
{
  
print "usage: $0 [-hvd] [-f file]";
exit;
}

init();

print STDERR "Verbose mode ON.\n" if $opt{v};
print STDERR "Debugging mode ON.\n" if $opt{d};
create_xml() if $opt{c};

#if (@ARGV == 2 ) {
#	print "Number of args . @ARGV \n";	
#	print "usage: `basename` <conf> <server>";
#	exit 0;
#}

#my $filename = $ARGV[0];

#my $parser = XML::LibXML->new();

#my $doc = $parser->parse_file($filename);


#my $query  = "//server[name/text() = '$ARGV[1]']/ip/text()";


#print $_->data . "\n" foreach ($doc->findnodes($query));


#system('ssh $_')


#foreach my $server ($doc->findnodes('/root/server')) {
#    my($name) = $server->findnodes('./name');
#    my($ip) = $server->findnodes('./ip');
#    print $name->to_literal," - "; 
#    print $ip->to_literal, "\n" 
#  }
